package org.eiahe.hr.interview.controller;

import lombok.RequiredArgsConstructor;
import org.ehe.common.core.BaseController;
import org.ehe.common.core.domain.R;
import org.ehe.common.mybatis.core.page.PageQuery;
import org.ehe.common.mybatis.core.page.TableDataInfo;
import org.eiahe.hr.interview.domain.InterviewBehaviorTestRecords;
import org.eiahe.hr.interview.domain.vo.InterviewBehaviorTestRecordsVO;
import org.eiahe.hr.interview.domain.dto.InterviewBehaviorTestRecordsQueryDTO;
import org.eiahe.hr.interview.service.InterviewBehaviorTestRecordsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :zhangnn
 * @className :InterviewBehaviorTestRecordsController
 * @description: TODO
 * @date 2025-08-20 15:38:07
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/interview/behavior/records")
public class InterviewBehaviorTestRecordsController extends BaseController {

    private final InterviewBehaviorTestRecordsService behaviorTestRecordsService;

    /**
     * 分页查询职位分类列表
     */
    @GetMapping("/page")
    public TableDataInfo<InterviewBehaviorTestRecordsVO> list(InterviewBehaviorTestRecordsQueryDTO queryDTO, PageQuery pageQuery) {
        TableDataInfo<InterviewBehaviorTestRecordsVO> page = behaviorTestRecordsService.behaviorTestRecords(queryDTO,pageQuery);
        return page;
    }

    /**
     * 根据code查看结果
     */
    @GetMapping("/{code}")
    public R<InterviewBehaviorTestRecords> getById(@PathVariable String code) {
        InterviewBehaviorTestRecords records = behaviorTestRecordsService.selectByCode(code);
        return R.ok(records);
    }
}
